-
Notifications
You must be signed in to change notification settings - Fork 14
chore: use tsx for Nx commands to execute local plugins same as other projects #1241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…s same as other projects
|
View your CI Pipeline Execution ↗ for commit 3571d73
☁️ Nx Cloud last updated this comment at |
@code-pushup/ci
@code-pushup/cli
@code-pushup/core
@code-pushup/create-cli
@code-pushup/models
@code-pushup/axe-plugin
@code-pushup/nx-plugin
@code-pushup/coverage-plugin
@code-pushup/eslint-plugin
@code-pushup/js-packages-plugin
@code-pushup/jsdocs-plugin
@code-pushup/lighthouse-plugin
@code-pushup/typescript-plugin
@code-pushup/utils
commit: |
Code PushUp🤨 Code PushUp report has both improvements and regressions – compared current commit 9f23abb with previous commit 3dbf378. 🕵️ See full comparison in Code PushUp portal 🔍 🏷️ Categories👎 2 groups regressed, 👍 4 audits improved, 👎 3 audits regressed, 12 audits changed without impacting score🗃️ Groups
32 other groups are unchanged. 🛡️ Audits
660 other audits are unchanged. |
The Code PushUp composite action uses npx tsx explicitly, so NODE_OPTIONS at job level causes "Post job cleanup" errors when tsx is no longer available. The runner script sets NODE_OPTIONS programmatically when needed. Co-authored-by: Cursor <cursoragent@cursor.com>
Remove extra blank lines to pass prettier checks Co-authored-by: Cursor <cursoragent@cursor.com>
Code PushUp🥳 Code PushUp report has improved – compared current commit 9f23abb with previous commit 3dbf378. 💼 Project
|
| 🏷️ Category | ⭐ Previous score | ⭐ Current score | 🔄 Score change |
|---|---|---|---|
| Code coverage | 🟢 95 | 🟢 95 | |
| Documentation | 🟡 61 | 🟡 61 |
4 other categories are unchanged.
👍 2 groups improved, 👍 1 audit improved
🗃️ Groups
| 🔌 Plugin | 🗃️ Group | ⭐ Previous score | ⭐ Current score | 🔄 Score change |
|---|---|---|---|---|
| Code coverage | Code coverage metrics | 🟢 95 | 🟢 95 | |
| JSDocs coverage | Documentation coverage | 🟡 61 | 🟡 61 |
13 other groups are unchanged.
🛡️ Audits
| 🔌 Plugin | 🛡️ Audit | 📏 Previous value | 📏 Current value | 🔄 Value change |
|---|---|---|---|---|
| Code coverage | Branch coverage | 🟩 91.9 % | 🟩 91.9 % |
443 other audits are unchanged.
13 other projects are unchanged.
E2E tests create temporary directories (e.g. tmp/e2e/plugin-eslint-e2e/)
and tsx was trying to resolve the relative path from the current working
directory instead of the workspace root, causing:
Error: Cannot resolve tsconfig at path:
/home/runner/work/cli/cli/tmp/e2e/plugin-eslint-e2e/tsconfig.base.json
Solution: Use absolute path ${{ github.workspace }}/tsconfig.base.json
in all workflow steps that set TSX_TSCONFIG_PATH.
Local .env.local can still use relative path since development happens
from the workspace root.
Co-authored-by: Cursor <cursoragent@cursor.com>
Problem
This repository uses local Nx plugins and async generators written in TypeScript that need to:
Without proper TypeScript execution setup, Nx commands fail when trying to execute these local plugins/generators.
Solution
Explicit environment variable configuration for both local development and CI:
.env.local(gitignored).env.local.exampleto.env.local.env.localfilesNODE_OPTIONS=--import tsx- Enables TypeScript executionTSX_TSCONFIG_PATH=tsconfig.base.json- Resolves path aliasesBackground
Why SWC is skipped when running Nx with
NODE_OPTIONS="--import tsx"Nx has hardcoded transpiler-selection logic for local TS/TSX execution (plugins, executors, generators).
When running with a Node loader like
tsx, Nx does not register SWC, even if SWC is available.Relevant source:
https://github.com/nrwl/nx/blob/81c157d0631927b3d1891453aa45652f3b5a7988/packages/nx/src/plugins/js/utils/register.ts
Key logic:
If
getTranspiler(...)returnsundefined, Nx intentionally does not register SWC or ts-node.getTranspiler(...)only detects:@swc-node/registerts-nodeNode loaders like
tsxare not detected, so:getTranspiler(...) === undefinedregisterTranspilerbecomes a no-opThis is not in
@nx/js:swc, but in Nx’s runtime TS/TSX plugin execution pipeline.Running with
NODE_OPTIONS="--import tsx"therefore bypasses SWC via hardcoded logic.Related: